import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';

void main() {
  runApp(MaterialApp(
    home: MyHome(),
  ));
}

// StatelessWidget 无状态组件
class MyHome extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      // 1.1 导航
      appBar: AppBar(
        backgroundColor: Colors.red,
        title: Text('案例-商品订单信息'),
      ),
      // 1.2 主体部分
      body: Container(
        padding: const EdgeInsets.all(10),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.end,
          children: [
            // 顶部
            const Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text('2025-4-12 16:06:10',
                    style: TextStyle(color: Colors.black, fontSize: 16)),
                Text(
                  '待发货',
                  style: TextStyle(color: Colors.orange, fontSize: 20),
                ),
              ],
            ),
            // 核心内容
            Row(
              children: [
                Image.asset(
                  'icons/bozai.png',
                  width: 180,
                  height: 180,
                ),
                Expanded(
                    child: Container(
                        padding: const EdgeInsets.all(10),
                        child: Container(
                          height: 180,
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            mainAxisAlignment: MainAxisAlignment.spaceAround,
                            children: [
                              const Row(
                                mainAxisAlignment:
                                    MainAxisAlignment.spaceBetween,
                                children: [
                                  Text(
                                    '茶水分离茶水分离茶水分离茶离',
                                  ),
                                  Text('x2')
                                ],
                              ),
                              Container(
                                padding: const EdgeInsets.all(10),
                                color: Colors.black38,
                                child: Text(
                                  '规格: 白色240ml',
                                  style: TextStyle(color: Colors.black38),
                                ),
                              ),
                              Text('¥ 119.5')
                            ],
                          ),
                        )))
              ],
            ),
            Text('合计:¥ 239.0'),
            Container(
              padding: const EdgeInsets.all(10),
              decoration: BoxDecoration(border: Border.all(width:2,color: Colors.black )),
              child: Text('再次购买',),
            ),
          ],
        ),
      ),
    );
  }
}
